<template>
    <div>
        <h3 class="title">{{goodsDesc.title}}</h3>
        <hr>
        <div class="content" v-html="goodsDesc.content"></div>
    </div>
</template>

<script>
export default {
    props:['goodsid'],
    data:function(){
        return {
            goodsDesc:{}
        }
    },
    created:function(){
        this.getGoodsDesc();
    },
    methods:{
        getGoodsDesc:async function(){
            const {data} = await this.$http.get('api/goods/getdesc/'+this.goodsid);
            console.log(data);
            if(data.status===0) this.goodsDesc=data.message[0];

        }
    }

}
</script>

<style lang="scss" scoped>
.title{
    font-size: 16px;
    margin: 10px 0;
    text-align: center;
    color:blue;
}
.content{
    padding: 0 10px;
    // 用 deep 穿透 ，或者给最外面的盒子写类名 让此样式成为唯一
    /deep/ img{
        width: 100%;
    }
}
</style>